<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%-- <%@ taglib prefix="security" uri=http://www.springframework.org/security/tags %> --%>
<%@ include file="../include/header.jsp" %>
			
			<div data-options="region:'west',border:false,split:true,minWidth:250,maxWidth:400" class="layout_center_west">
				<div class="easyui-accordion" data-options="fit:true">
					<div title="검색" class="lnb search_02" data-options="iconCls:'icon-bullet',href:'/dic_search',selected:true">
					</div>
					<div title="TOP30" class="lnb search_01" data-options="iconCls:'icon-bullet',href:'/dic_top30'">
					</div>
					<div title="즐겨찾기" class="lnb search_01" data-options="iconCls:'icon-bullet',href:'/dic_favorite'">
					</div>
					<div title="전체보기" class="lnb search_01" data-options="iconCls:'icon-bullet',href:'/dic_tree'">
					</div>
				</div>
				<div id="west_collapse" class="west_collapse" title="Close"><a></a></div>
			</div>
			
			<div data-options="region:'center',border:false,maximizable:true" class="layout_center_center">
				<h1>용어사전</h1>
				<div id="dic" class="easyui-tabs" data-options="fit:true">
				    <div title="용어사전 사용법" data-options="iconCls:'icon-help',href:''">
				    </div>
				</div>
			</div>		

<%@ include file="../include/footer.jsp" %>


<script type="text/javascript">
$(document).ready(function() {
	var thismenu = $('.nav td a.menu_01');
	$(thismenu).addClass('active');

});
function addTab(title, url){
	if ($('#dic').tabs('exists', title)){
		$('#dic').tabs('select', title);
	} else {
		$('#dic').tabs('add',{
			title:title,
			href:url,
			fit:true,
			tools:[{  
		         iconCls:'icon-favorit-on'
// 		         handler:function(){  
// 		           alert('add');  
// 		         }  
		    }],
			//toolPosition:'left',
			closable:true
		});
		$('#dic').find('.tabs-p-tool').addClass('btn_favorite').prev('a.tabs-inner').css('padding','0 0 0 24px');
	}
}

//툴바 리사이즈
$(window).resize(function() {
	step1();
});

$(window).bind('resizeEnd', function() {
	step2();
});
function step1(){
	if(this.resizeTO) clearTimeout(this.resizeTO);
    this.resizeTO = setTimeout(function() {
        $(this).trigger('resizeEnd');
    }, 0);
};
function step2(){
	var toolw = $(".tabs-panels").width() - 10;
	$('.tab_toolbar').css('width', toolw);
};
function toolbar() {
	step2();
}

( function( $ ) {
	"use strict";

	// Define default settings
	var defaults = {
		action: function() {},
		runOnLoad: false,
		duration: 500
	};

	// Define global variables
	var settings = defaults,
		running = false,
		start;

	var methods = {};

	// Initial plugin configuration
	methods.init = function() {

		// Allocate passed arguments to settings based on type
		for( var i = 0; i <= arguments.length; i++ ) {
			var arg = arguments[i];
			switch ( typeof arg ) {
				case "function":
					settings.action = arg;
					break;
				case "boolean":
					settings.runOnLoad = arg;
					break;
				case "number":
					settings.duration = arg;
					break;
			}
		}

		// Process each matching jQuery object
		return this.each(function() {

			if( settings.runOnLoad ) { settings.action(); }

			$(this).resize( function() {

				methods.timedAction.call( this );

			} );

		} );
	};

	methods.timedAction = function( code, millisec ) {

		var doAction = function() {
			var remaining = settings.duration;

			if( running ) {
				var elapse = new Date() - start;
				remaining = settings.duration - elapse;
				if( remaining <= 0 ) {
					// Clear timeout and reset running variable
					clearTimeout(running);
					running = false;
					// Perform user defined function
					settings.action();

					return;
				}
			}
			wait( remaining );
		};

		var wait = function( time ) {
			running = setTimeout( doAction, time );
		};

		// Define new action starting time
		start = new Date();

		// Define runtime settings if function is run directly
		if( typeof millisec === 'number' ) { settings.duration = millisec; }
		if( typeof code === 'function' ) { settings.action = code; }

		// Only run timed loop if not already running
		if( !running ) { doAction(); }

	};


	$.fn.afterResize = function( method ) {

		if( methods[method] ) {
			return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ) );
		} else {
			return methods.init.apply( this, arguments );
		}

	};

})(jQuery);
</script>